home *** CD-ROM | disk | FTP | other *** search
- unit HintMain;
-
- interface
-
- uses
- Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
- StdCtrls, EPHints, ExtCtrls, AppEvnts;
-
- type
- TForm1 = class(TForm)
- Button1: TButton;
- Label1: TLabel;
- Button2: TButton;
- Button3: TButton;
- Button4: TButton;
- Label2: TLabel;
- Label3: TLabel;
- Label4: TLabel;
- Button5: TButton;
- Button6: TButton;
- EPHints1: TEPHints;
- procedure Button1Click(Sender: TObject);
- procedure Button2Click(Sender: TObject);
- procedure FormCreate(Sender: TObject);
- procedure Button5Click(Sender: TObject);
- procedure Button6Click(Sender: TObject);
- private
- procedure UpdateColors;
- public
- { Public declarations }
- end;
-
- var
- Form1: TForm1;
-
- implementation
-
- uses Unit2;
-
- {$R *.DFM}
-
- procedure TForm1.Button1Click(Sender: TObject);
- begin
- EPHints1.Tag:=EPHints1.Tag+1;
- If EPHints1.Tag>2 Then EPHints1.Tag:=0;
- case EPHints1.Tag of
- 0: begin
- EPHints1.Enabled:=False;
- Button1.Caption:='EPHints Disabled';
- end;
- 1: begin
- EPHints1.Enabled:=True;
- EPHints1.HintType:=ephtNormal;
- Button1.Caption:='Normal EPHints';
- end;
- 2: begin
- EPHints1.Enabled:=True;
- EPHints1.HintType:=ephtBaloon;
- Button1.Caption:='Baloon EPHints';
- end;
- end;
- end;
-
- procedure TForm1.Button2Click(Sender: TObject);
- var
- AColor: TColor;
- begin
- With TColorDialog.Create(nil) do
- try
- if Execute then
- begin
- AColor:=Color;
- case TButton(Sender).Tag of
- 0:EPHints1.HintColor:=AColor;
- 1:EPHints1.HintBorderColor:=AColor;
- 2:EPHints1.HintTextColor:=AColor;
- end;
- UpdateColors;
- end;
- finally
- Free;
- end;
- end;
-
- procedure TForm1.UpdateColors;
- begin
- Label2.Caption:=ColorToString(EPHints1.HintColor);
- Label2.Font.Color:=EPHints1.HintColor;
- Label3.Caption:=ColorToString(EPHints1.HintBorderColor);
- Label3.Font.Color:=EPHints1.HintBorderColor;
- Label4.Caption:=ColorToString(EPHints1.HintTextColor);
- Label4.Font.Color:=EPHints1.HintTextColor;
- If EPHints1.DefaultColors then
- Button5.Caption:='Use Custom Hint Colors'
- else
- Button5.Caption:='Use Default Hint Colors';
- end;
-
- procedure TForm1.FormCreate(Sender: TObject);
- begin
- UpdateColors;
- end;
-
- procedure TForm1.Button5Click(Sender: TObject);
- begin
- EPHints1.DefaultColors:=not EPHints1.DefaultColors;
- UpdateColors;
- end;
-
- procedure TForm1.Button6Click(Sender: TObject);
- begin
- With TForm2.Create(nil) do
- Show;
- end;
-
- end.
-